package logic

import (
	"context"
	"merchantmanager/merchantrpc/mysql"

	"merchantmanager/merchantrpc/internal/svc"
	"merchantmanager/merchantrpc/merchantrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelLogic {
	return &DelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 删除
func (l *DelLogic) Del(in *merchantrpc.DelRequest) (*merchantrpc.DelResponse, error) {
	// todo: add your logic here and delete this line
	mysql.DB.Where("id=?", in.Id).Delete(&mysql.Merchant{})
	return &merchantrpc.DelResponse{}, nil
}
